<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class JkblTimingConfig extends Model
{
    public $timestamps = false;
    protected $table = "jkbl_timing_config";

    /**
     * 修改配置
     * @param $config
     * @param $request
     * @return array
     */
    static function ConfigModify($config, $request)
    {
        foreach (['order_close_time', 'order_done_time'] as $item) {
            $config->$item = $request->$item;
        }

        if (!$config->save()) {
            return error();
        }
        return success();
    }
}
